package cn.bdqn.services.dept.controller;

import cn.bdqn.model.pojo.Dept;
import cn.bdqn.services.dept.service.DeptService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author 徐凤年
 * @Date 2022/3/25 14:45
 * @Version 1.0
 */
@RestController
public class DeptController {
    @Resource
    private DeptService service;
    @RequestMapping(value = "/dept/get/{id}",method = RequestMethod.GET)
    public Dept getDeptId(@PathVariable("id") int id){
        System.out.println("............");
        return service.getDeptId(id);
    }

    @RequestMapping(value = "/dept/add",method = RequestMethod.POST)
    public boolean deptAdd(@RequestBody Dept dept){
        return service.deptAdd(dept);
    }
    @RequestMapping(value = "/dept/list",method = RequestMethod.GET)
    public List<Dept> getDeptList(){
        return service.getDeptList();
    }
}
